package com.cv.audit.controller.audit.report;

import com.cv.audit.controller.audit.report.vo.AuditReportLogPageReqVO;
import com.cv.audit.controller.audit.report.vo.AuditReportLogRespVO;
import com.cv.audit.controller.audit.report.vo.AuditReportLogSaveReqVO;
import com.cv.audit.service.report.AuditReportLogService;
import com.cv.framework.common.pojo.PageResult;
import com.cv.framework.common.pojo.Result;
import com.cv.framework.role.core.annotations.RolePermit;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

import static com.cv.framework.common.pojo.Result.success;

/**
 * 举报日志控制层
 *
 * @author Charles_XDXD
 */
@Tag(name = "举报日志控制层")
@RestController
@RequestMapping("/audit/report/log")
public class AuditReportLogController {

    @Resource
    private AuditReportLogService auditReportLogService;

    @PostMapping("save")
    @Operation(summary = "保存举报日志")
    @RolePermit(values = "customer_service")
    public Result<Void> saveAuditReportLog(@RequestBody AuditReportLogSaveReqVO reqVO) {
        auditReportLogService.saveAuditReportLog(reqVO);
        return success();
    }

    @PostMapping("page")
    @Operation(summary = "分页查询举报日志")
    @RolePermit(values = "customer_service")
    public Result<PageResult<AuditReportLogRespVO>> getPage(@RequestBody AuditReportLogPageReqVO reqVO) {
        return success(auditReportLogService.getPage(reqVO));
    }

}
